﻿using System;
using System.Collections.Generic;

namespace DomainModel
{
    public class StudyYear : BaseEntity
    {
        private readonly List<StudySemester> _studySemesters;

        protected StudyYear()
        {
            _studySemesters = new List<StudySemester>();
        }

        public StudyYear(DateTime beginDate, DateTime endDate)
        {
            BeginDate = beginDate;
            EndDate = endDate;
        }

        public virtual DateTime BeginDate { get; set; }
        public virtual DateTime EndDate { get; set; }
        public virtual string Name
        {
            get
            {
                return string.Format("{0} - {1}", BeginDate.Year, EndDate.Year);
            }
        }

        public virtual IEnumerable<StudySemester> StudySemesters
        {
            get { return _studySemesters; }
        } 
    }
}